package com.youxin.cpcenter.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.youxin.busfoundation.bean.login.UserInfo;
import com.youxin.busfoundation.bean.orderinfo.ResponseOrderinfoBean;
import com.youxin.busfoundation.common.LoginAuth;
import com.youxin.cpcenter.bean.ConsumQueryListBean;
import com.youxin.cpcenter.dao.TbMemberInfoMapper;
import com.youxin.cpcenter.dao.TbOrderInfoMapper;
import com.youxin.cpcenter.model.TbMemberInfo;
import com.youxin.cpcenter.service.OrderInfoService;
import com.youxin.cpcenter.utils.MemberRightsUtils;

/**
 * 企业认证信息接口
 * 
 * @author yingde.cao
 *
 */
@Service("orderInfoService")
public class OrderInfoServiceImpl implements OrderInfoService {

	@Autowired
	private TbOrderInfoMapper tbOrderInfoMapper;
	/**
	 * 支付消费列表
	 */
	public List<ResponseOrderinfoBean> payConsumList(ConsumQueryListBean bean) {
		//查询会员
		UserInfo userInfo=LoginAuth.getUserInfo();
		bean.setEntIdentifyId(userInfo.getEntIdentifyId());
		//管理员可看全部
		if(userInfo.isAdmin())
		{
			bean.setEntMemberId(userInfo.getEntMemberId());
		}else {
			bean.setMemberId(userInfo.getId());
		}
		List<ResponseOrderinfoBean> list = tbOrderInfoMapper.selectPayConsumingList(bean);
		bean.setResults(list);
		return list;
	}
}
